package com.zsx.shopping.search.controller;

import com.zsx.shopping.common.api.R;
import com.zsx.shopping.common.api.search.dto.SkuEsDto;
import com.zsx.shopping.search.service.SaveService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/search/save")
public class SaveController {

    @Resource
    private SaveService saveService;

    @PostMapping("/product")
    public R<Void> saveProduct(List<SkuEsDto> skuEsDtos) {
        saveService.saveProduct(skuEsDtos);
        return R.success();
    }
}
